<%@page contentType="text/xml" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!--
    Data Employee
-->

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:ev="http://www.w3.org/2001/xml-events">

    <head>

        <xf:model>
            <xf:instance>
                <xf:data xmlns="">
                    <id xsi:type="xsd:id"/>
                    <nome xsi:type="xsd:string"/>
                    <cognome xsi:type="xsd:string"/>
                    <email xsi:type="xsd:string"/>
                </xf:data>
            </xf:instance>
            <xf:bind id="nome" nodeset="/data/nome" required="true()" xsi:type="xsd:string"></xf:bind>
            <xf:bind id="cognome" nodeset="/data/cognome" required="true()" xsi:type="xsd:string"></xf:bind>
            <xf:bind id="email" nodeset="/data/email" required="true()" xsi:type="xsd:string"></xf:bind>
            <!--
            <xf:action ev:event="xforms-ready">
                <xf:setvalue ref="nome">Mrloba</xf:setvalue>
                <xf:message level="modal">Hello, <xf:output ref="nome"/>!</xf:message>
            </xf:action>
            -->
            <xf:submission id="employee" action="" method="post" replace="none">
                <xf:message ev:event="xforms-submit-error">A submission error (<xf:output value="event('error-type')"/>) occurred.</xf:message>
            </xf:submission>
            
        </xf:model>

        <title>XForm</title>
    </head>
    <body>

        <h1>Employee</h1>

        <div>
            <xf:group>
                <xf:input ref="nome">
                    <xf:label>Nome:</xf:label>
                    <xf:hint>Inserire il proprio nome</xf:hint>
                </xf:input>
                <xf:input ref="cognome">
                    <xf:label>Cognome:</xf:label>
                    <xf:hint>Inserire il proprio cognome</xf:hint>
                </xf:input>
                <xf:input ref="email">
                    <xf:label>Email:</xf:label>
                    <xf:hint>Inserire una email valida. Es: example@example.it</xf:hint>
                </xf:input>
                <xf:submit submission="employee">
                    <xf:label>Invia</xf:label>
                </xf:submit>
            </xf:group>
        </div>


    </body>
</html>
